<?php

$path = 'C:\xampp\htdocs\ResumeBuilder\library';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
require_once 'Zend\Service\LiveDocx\MailMerge.php';


echo "php works on server! ....";

$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
 
echo "step 1...logging in... ";

$phpLiveDocx->setUsername('desilvam');
$phpLiveDocx->setPassword('tennis01');

echo "step 2 - setting template...  ";

//$phpLiveDocx->setLocalTemplate('c:\junk\melvin.doc');
//$phpLiveDocx->setLocalTemplate('c:\junk\resume.rtf');
//$phpLiveDocx->setRemoteTemplate('melvin.doc');
$phpLiveDocx->setRemoteTemplate('livedocxtest.rtf');

echo "step 3...  creating document...  ";
 
$phpLiveDocx->createDocument();

echo "step 4... retrieving document.. ";

$document = $phpLiveDocx->retrieveDocument('pdf');
file_put_contents('c:\junk\livedocx_resume.pdf', $document);

echo "..  wohoo!   success!  .. ";

?>